/**
 * 2010-2011 xiha.org
 */
package org.xiha.wiki.database;

import org.xiha.wiki.domain.AckCatalog;

import com.sleepycat.bind.EntryBinding;
import com.sleepycat.bind.serial.ClassCatalog;
import com.sleepycat.bind.serial.SerialBinding;
import com.sleepycat.collections.StoredMap;

/**
 * @author summer
 * 
 */
public class AckCatalogView {
    private StoredMap<String, AckCatalog> ackCatalogMap;
    
    public AckCatalogView(BasicDatabase db) {
        ClassCatalog catalog = db.getJavaCatalog();
        
        EntryBinding<AckCatalog> ackCBinding = new SerialBinding<AckCatalog>(catalog, AckCatalog.class);
        
        EntryBinding<String> ackCKBinding = new SerialBinding<String>(catalog, String.class);
        
        ackCatalogMap = new StoredMap<String, AckCatalog>(db.getAckCatalogDb(), ackCKBinding, ackCBinding, true);
    }
    
    public final StoredMap<String, AckCatalog> getAckCatalogStoredMap() {
        return ackCatalogMap;
    }
    
}
